home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 2
/
Amiga Tools 2.iso
/
dfue
/
avmnfax
/
rexx
/
moveto.avm
< prev
next >
Wrap
Text File
|
1995-03-09
|
2KB
|
56 lines
/* copies a log from one mailbox to another */
parse upper arg mailbox mailbox2 logs
if upper(mailbox) = upper(mailbox2) then exit
numlogs = words(logs)
do i = 1 to numlogs
call loadLogEntry(mailbox, word(logs, i))
/* copy log itself */
address command 'copy >nil: <nil: quiet' logFile(mailbox, word(logs, i)) || "#?" logFile(mailbox2, '')
/* copy filenames referenced if they aren't absolute filenames */
if (log.fileName ~= "" & (verify(log.fileName, '/:', 'M') = 0)) then
address command 'copy >nil: <nil: quiet' voiceFile(mailbox, log.fileName) || "#?" voiceFile(mailbox2, '')
if (log.altFileName ~= "" & (verify(log.altFileName, '/:', 'M') = 0)) then
address command 'copy >nil: <nil: quiet' voiceFile(mailbox, log.altFileName) || "#?" voiceFile(mailbox2, '')
address rexx 'broadcast' 'addtomailbox' mailbox2 word(logs, i)
end
/* delete logs from original place */
address rexx 'delete' mailbox logs
exit
error:
exit
voiceFile: procedure
parse arg mailbox, magiccookie
return 'avm:' || mailbox || '/voices/' || magiccookie
logFile: procedure
parse arg mailbox, magiccookie
return 'avm:' || mailbox || '/logs/' || magiccookie
loadLogEntry: procedure expose log.
if arg() ~= 2 then do
rc = "loadLogEntry: bad args"
signal error
end
parse arg mailbox, handle
call open(handle, logFile(mailbox, handle), 'r')
do while ~eof(handle)
line = readln(handle)
parse upper var line variable '=' value
log.variable = value
end
call close(handle)
return